<template>
  <div>
    <div style="display: inline-block;font-size:18px;margin-bottom: 15px;">
      <a href="#" @click="prev" style="text-decoration:none;font-size: 14px;">
        <icon-svg name="jiantou" style="width: 1.2em;height: 1.2em;position: relative;top: 0.3em;"></icon-svg>
        返回
      </a>
      <span style="display: inline-block;margin: 0 15px;color: #D9D9D9;">|</span>
      <span>管理员详情</span>
    </div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="代理信息" name="first">
        <div class="shop_item">
          <el-row>
            <el-col :span="6" class="cards">
              <div class="box">
                <div class="box_num">
                  <div class="box_color">代理城市</div>
                  <div class="text_color"><span>{{detail.city}}</span></div>
                </div>
              </div>
            </el-col>
            <el-col :span="6" class="cards">
              <div class="box">
                <div class="box_num">
                  <div class="box_color">管理员昵称</div>
                  <div class="text_color"><span>{{detail.username}}</span></div>
                </div>
              </div>
            </el-col>
            <el-col :span="6" class="cards">
              <div class="box">
                <div class="box_num">
                  <div class="box_color">手机号</div>
                  <div class="text_color"><span>{{detail.mobile}}</span></div>
                </div>
              </div>
            </el-col>
            <el-col :span="6" class="cards">
              <div class="box">
                <div class="box_num">
                  <div class="box_color">邮箱</div>
                  <div class="text_color"><span>{{detail.email}}</span></div>
                </div>
              </div>
            </el-col>
           <!-- <el-col :span="6" class="cards">
              <div class="box">
                <div class="box_num">
                  <div class="box_color">代理佣金比例</div>
                  <div class="text_color"><span>{{detail.rate?detail.rate:0 | numFilter}}</span></div>
                </div>
              </div>
            </el-col> -->

            <el-col :span="6" class="cards">
              <div class="box">
                <div class="box_num">
                  <div class="box_color">钱包余额</div>
                  <div class="text_color"><span>{{tableData.money?tableData.money:0 | numFilter}}元</span>
                    <el-button size="mini" type="warning" v-if="isAuth('managementStoreincome:draw')"
                      @click="depositType()" style="margin: 3px;">提现
                    </el-button>
                    <el-button size="mini" type="primary" v-if="isAuth('sys:agentMoney:update')"
                      @click="depositTx()" style="margin: 3px;">修改
                    </el-button>
                  </div>
                </div>
              </div>
            </el-col>
            <!-- <el-col :span="5">
						<span>商户余额:</span>
						<span>{{tableData.money?tableData.money:0 | numFilter}}元</span>
					</el-col> -->
            <el-col :span="6" class="cards">
              <div class="box">
                <div class="box_num">
                  <div class="box_color">支付宝账号</div>
                  <div class="text_color">{{detail.zhifubao?detail.zhifubao:'未绑定'}}</div>
                </div>
              </div>
            </el-col>
            <el-col :span="6" class="cards">
              <div class="box">
                <div class="box_num">
                  <div class="box_color">支付宝名称</div>
                  <div class="text_color">{{detail.zhifubaoName?detail.zhifubaoName:'未绑定'}}</div>
                </div>
              </div>
            </el-col>
            <el-col :span="6" class="cards">
              <div class="box">
                <div class="box_num">
                  <div class="box_color">微信提现二维码</div>
                  <div class="text_color text_color1">
                    <img v-if="tableData.cashQrCode" :src="tableData.cashQrCode" style="width: 80px;height: 80px;" />
                  </div>
                </div>
              </div>
            </el-col>
            <!-- <el-col :span="6" class="cards">
							<div class="box">
								<div class="box_num">
									<div class="box_color">银行卡名称:</div>
									<div class="text_color">{{tableData.bankCardName?tableData.bankCardName:'未绑定'}}
									</div>
								</div>
							</div>
						</el-col>
						<el-col :span="6" class="cards">
							<div class="box">
								<div class="box_num">
									<div class="box_color">绑定银行卡姓名:</div>
									<div class="text_color">
										{{tableData.bankCardUserName?tableData.bankCardUserName:'未绑定'}}</div>
								</div>
							</div>
						</el-col>
						<el-col :span="6" class="cards">
							<div class="box">
								<div class="box_num">
									<div class="box_color">银行卡账号:</div>
									<div class="text_color">{{tableData.bankCard?tableData.bankCard:'未绑定'}}</div>
								</div>
							</div>
						</el-col>
						<el-col :span="6" class="cards">
							<div class="box">
								<div class="box_num">
									<div class="box_color">银行卡开户地址:</div>
									<div class="text_color">
										{{tableData.bankCardAddress?tableData.bankCardAddress:'未绑定'}}</div>
								</div>
							</div>
						</el-col> -->

          </el-row>
          <div style="text-align: right;margin: 10px 20px;">
            <!-- <el-button size="mini" type="primary" v-if="isAuth('managementStoreincome:update')"
						@click="updatesEwm(tableData)" style="margin: 3px;">修改微信二维码
					</el-button> -->
            <!-- <el-button size="mini" type="primary" v-if="isAuth('managementStoreincome:update')"
							@click="updates(tableData)" style="margin: 3px;">修改支付宝账号
						</el-button> -->

          </div>
        </div>
        <!-- 修改支付宝信息 -->
        <el-dialog title="修改支付宝信息" :visible.sync="dialogFormVisible" center>
          <el-form :model="form">
            <el-form-item label="支付宝账号：" :label-width="formLabelWidth">
              <el-input v-model="form.zhiFuBao" style="width:65%;" placeholder="请输入支付宝账号"></el-input>
            </el-form-item>
            <el-form-item label="支付宝名称：" :label-width="formLabelWidth">
              <el-input v-model="form.zhiFuBaoName" style="width:65%;" placeholder="请输入支付宝名称"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="amendNoticeTo()">确 定</el-button>
          </div>
        </el-dialog>
        <!-- 提现申请 -->
        <el-dialog title="提现申请提示" :visible.sync="dialogFormVisible1" v-loading="tableDataLoading1" center>
          <div style="margin-bottom: 10px;">
            <span style="width: 200px;display: inline-block;text-align: right;">提现类型：</span>
            <el-radio-group v-model="txtype">
              <el-radio :label="2">支付宝</el-radio>
              <el-radio :label="1">微信</el-radio>
            </el-radio-group>
          </div>
          <el-form :model="form1">
            <el-form-item :label-width="formLabelWidth">
              <p>请仔细确认收款人信息</p>
            </el-form-item>
            <el-form-item label="提现金额：" :label-width="formLabelWidth">
              <el-input v-model="outMoney" style="width:65%;" type="number" placeholder="请输入提现金额">
              </el-input>
            </el-form-item>
            <el-form-item label="支付宝名称：" :label-width="formLabelWidth" v-if="txtype==2">
              <span>{{form1.zhiFuBaoName}}</span>
            </el-form-item>
            <el-form-item label="支付宝账号：" :label-width="formLabelWidth" v-if="txtype==2">
              <span>{{form1.zhiFuBao}}</span>
            </el-form-item>
            <el-form-item label="微信二维码：" :label-width="formLabelWidth" v-if="txtype==1">
               <img v-if="tableData.cashQrCode" :src="tableData.cashQrCode" style="width: 80px;height: 80px;" />
             </el-form-item>
           <!-- <el-form-item label="银行卡名称：" :label-width="formLabelWidth" v-if="txtype==2">
              <span>{{form1.bankCardName}}</span>
            </el-form-item>
            <el-form-item label="银行卡账号：" :label-width="formLabelWidth" v-if="txtype==2">
              <span>{{form1.bankCard}}</span>
            </el-form-item>
            <el-form-item label="银行卡姓名：" :label-width="formLabelWidth" v-if="txtype==2">
              <span>{{form1.bankCardUserName}}</span>
            </el-form-item>
            <el-form-item label="开户行地址：" :label-width="formLabelWidth" v-if="txtype==2">
              <span>{{form1.bankCardAddress}}</span>
            </el-form-item> -->
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible1 = false">取 消</el-button>
            <el-button type="primary" @click="depositTo()">确 定</el-button>
          </div>
        </el-dialog>
      </el-tab-pane>
      <el-tab-pane label="提现记录" name="tixian">
        <el-table v-loading="tableDataLoading" :data="withdrawData.list">
          <el-table-column fixed prop="id" label="编号" width="80">
          </el-table-column>
          <el-table-column prop="zhifubao" label="支付宝账号">
            <template slot-scope="scope">
              <span>{{scope.row.zhifubao ? scope.row.zhifubao : '未绑定'}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="zhifubaoName" label="支付宝名称" width="100">
            <template slot-scope="scope">
              <span>{{scope.row.zhifubaoName ? scope.row.zhifubaoName : '未绑定'}}</span>
            </template>
          </el-table-column>
          <!-- <el-table-column prop="bankCardUserName" label="绑定银行卡姓名" width="100">
            <template slot-scope="scope">
              <span>{{scope.row.bankCardUserName ? scope.row.bankCardUserName : '未绑定'}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="bankCardName" label="银行名称" width="100">
            <template slot-scope="scope">
              <span>{{scope.row.bankCardName ? scope.row.bankCardName : '未绑定'}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="bankCard" label="银行卡账号" width="100">
            <template slot-scope="scope">
              <span>{{scope.row.bankCard ? scope.row.bankCard : '未绑定'}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="bankCardAddress" label="开户行地址" width="100">
            <template slot-scope="scope">
              <span>{{scope.row.bankCardAddress ? scope.row.bankCardAddress : '未绑定'}}</span>
            </template>
          </el-table-column> -->
          <el-table-column prop="money" label="提现金额">
          </el-table-column>
          <el-table-column prop="refund" label="拒绝理由">
            <template slot-scope="scope">
              <span>{{scope.row.refund ? scope.row.refund : '未拒绝'}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="createAt" label="申请时间" width="170">
          </el-table-column>
          <el-table-column prop="outAt" label="转账/拒绝时间" width="160">
          </el-table-column>
          <el-table-column prop="orderNumber" label="转账订单号" width="150">
          </el-table-column>
          <el-table-column prop="type" label="提现方式" width="150">
            <template slot-scope="scope">
              <span v-if="scope.row.classify == 1">微信</span>
              <span v-else-if="scope.row.classify == 2">支付宝</span>
              <span v-else> -</span>
            </template>
          </el-table-column>
          <el-table-column prop="state" label="状态" width="100">
            <template slot-scope="scope">
              <span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.state == 0">待转账</span>
              <span v-if="scope.row.state == 1">已转账</span>
              <span v-if="scope.row.state == -1">已拒绝</span>
            </template>
          </el-table-column>
        </el-table>
        <div style="text-align: center;margin-top: 10px;">
          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
            :page-sizes="[10, 20, 30, 50, 100]" :page-size="size" :current-page="page"
            layout="total,sizes, prev, pager, next" :total="withdrawData.totalCount">
          </el-pagination>
        </div>
      </el-tab-pane>
      <el-tab-pane label="钱包明细" name="yue">
        <el-table v-loading="tableDataLoading" :data="tableDataYe.records">

          <el-table-column prop="detailsId" label="编号" width="80">
          </el-table-column>
          <el-table-column prop="title" label="标题">
          </el-table-column>
          <el-table-column prop="content" label="内容">
          </el-table-column>
          <el-table-column prop="money" label="金额">
            <template slot-scope="scope">
              <span v-if="scope.row.type==1" style="color:limegreen;cursor: pointer;">+{{scope.row.money}}</span>
              <span v-else style="color: red;cursor: pointer;">-{{scope.row.money}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="createTime" label="时间">
          </el-table-column>
        </el-table>
        <div style="text-align: center;margin-top: 10px;">
          <el-pagination @size-change="handleSizeChangeYe" @current-change="handleCurrentChangeYe"
            :page-sizes="[10, 20, 30, 50, 100]" :page-size="size" :current-page="page"
            layout="total,sizes, prev, pager, next" :total="tableDataYe.total">
          </el-pagination>
        </div>
      </el-tab-pane>
      <el-tab-pane label="提现账号" name="zhanghao">
        <div style="position: relative;margin: 10px 0px;">
          <span>支付宝名称：</span>
          <el-input style="width: 200px;" placeholder="请输入支付宝名称" v-model="tixianData.zhifubaoName">
          </el-input>&nbsp;&nbsp
        </div>
        <div style="margin:10px 0;">
          <span>支付宝账号：</span>
          <el-input style="width: 200px;" clearable placeholder="请输入支付宝账号" v-model="tixianData.zhifubao">
          </el-input>&nbsp;&nbsp;&nbsp;&nbsp;
        </div>
        <!-- <div style="margin:10px 0;">
          <span>银行卡名称：</span>
          <el-input style="width: 200px;" clearable placeholder="请输入银行卡名称" v-model="tixianData.bankCardName">
          </el-input>&nbsp;&nbsp;&nbsp;&nbsp;
        </div>
        <div style="position: relative;margin: 10px 0px;">
          <span>银行卡账号：</span>
          <el-input style="width: 200px;" placeholder="请输入银行卡账号" v-model="tixianData.bankCard">
          </el-input>&nbsp;&nbsp
        </div>
        <div style="margin:10px 0;">
          <span>银行卡姓名：</span>
          <el-input style="width: 200px;" clearable placeholder="请输入银行卡姓名" v-model="tixianData.bankCardUserName">
          </el-input>&nbsp;&nbsp;&nbsp;&nbsp;
        </div>
        <div style="position: relative;margin: 10px 0px;">
          <span>开户行地址：</span>
          <el-input style="width: 200px;" placeholder="请输入开户行地址" v-model="tixianData.bankCardAddress">
          </el-input>&nbsp;&nbsp
        </div> -->
        <div style="margin:10px 0;">
				<span>提现二维码：</span>
				<div
					style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;">
					<el-upload class="avatar-uploader" v-model="tixianData.cashQrCode"
						:action="$http.adornUrlUp('alioss/upload')" :show-file-list="false"
						:on-success="handleAvatarSuccess1">
						<img v-if="tixianData.cashQrCode" :src="tixianData.cashQrCode" class="avatar"
							style="width: 148px;height: 148px;" />
						<i v-else class="el-icon-plus avatar-uploader-icon" style="font-size: 28px;color: #8c939d"></i>
					</el-upload>
				</div>
			</div>
        <el-button style="margin:50px;" type="primary" icon="document"
          :disabled="!isAuth('managementStoreincome:update')" @click="querenBtn">确认
        </el-button>
      </el-tab-pane>
      <el-tab-pane label="数据统计" name="second">
        <div>
          <div class="record_date">
            <el-row>
              <el-col :span="6" class="cards">
                <div class="box">
                  <div class="box_num">
                    <div class="box_color">总用户数</div>
                    <div class="text_color"><span>{{tableData.totalUsers ? tableData.totalUsers : 0}}</span>人
                    </div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6" class="cards">
                <div class="box">
                  <div class="box_num">
                    <div class="box_color">今日新增</div>
                    <div class="text_color"><span>{{tableData.newToday ? tableData.newToday : 0}}</span>人</div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6" class="cards">
                <div class="box">
                  <div class="box_num">
                    <div class="box_color">本月新增</div>
                    <div class="text_color"><span>{{tableData.newMonth ? tableData.newMonth : 0}}</span>人</div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6" class="cards">
                <div class="box">
                  <div class="box_num">
                    <div class="box_color">本年新增</div>
                    <div class="text_color"><span>{{tableData.newYear ? tableData.newYear : 0}}</span>人</div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6" class="cards">
                <div class="box">
                  <div class="box_num">
                    <div class="box_color">总充值 </div>
                    <div class="text_color">
                      <span>{{tableData.totalRevenue ? tableData.totalRevenue : 0}}</span>元
                    </div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6" class="cards">
                <div class="box">
                  <div class="box_num">
                    <div class="box_color">今日充值</div>
                    <div class="text_color">
                      <span>{{tableData.todayRevenue ? tableData.todayRevenue : 0 }}</span>元
                    </div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6" class="cards">
                <div class="box">
                  <div class="box_num">
                    <div class="box_color">本月充值 </div>
                    <div class="text_color">
                      <span>{{tableData.monthRevenue ? tableData.monthRevenue : 0}}</span>元
                    </div>
                  </div>
                </div>
              </el-col>
              <el-col :span="6" class="cards">
                <div class="box">
                  <div class="box_num">
                    <div class="box_color">本年充值</div>
                    <div class="text_color"><span>{{tableData.yearRevenue ? tableData.yearRevenue : 0}}</span>元
                    </div>
                  </div>
                </div>
              </el-col>

            </el-row>
            <div>
              <el-select v-model="flag" style="width:150px;margin-left: 10px;" @change="orderfenxi">
                <el-option v-for="item in flags" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>&nbsp;&nbsp;&nbsp;
              <el-date-picker style="width: 200px;margin-left: 10px;" v-model="info.stockDate" align="right" type="date"
                format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间" @change="animeOrder">
              </el-date-picker>
            </div>
            <el-tabs v-model="activeNameSj" @tab-click="handleClickSj" style="margin-left: 10px;">

              <el-tab-pane label="订单统计" name="first">
                <el-row>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">总订单</div>
                        <div class="text_color">
                          <span>{{orderStat.allCount ? orderStat.allCount : 0}}</span>单
                        </div>
                      </div>
                    </div>
                  </el-col>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">待支付订单</div>
                        <div class="text_color">
                          <span>{{orderStat.daiZhiFu ? orderStat.daiZhiFu : 0}}</span>单
                        </div>
                      </div>
                    </div>
                  </el-col>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">待接单订单</div>
                        <div class="text_color">
                          <span>{{orderStat.daiJieDan ? orderStat.daiJieDan : 0}}</span>单
                        </div>
                      </div>
                    </div>
                  </el-col>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">进行总订单</div>
                        <div class="text_color">
                          <span>{{orderStat.jinXingZhong ? orderStat.jinXingZhong : 0}}</span>单
                        </div>
                      </div>
                    </div>
                  </el-col>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">已接单订单</div>
                        <div class="text_color">
                          <span>{{orderStat.yiJieiDan ? orderStat.yiJieiDan : 0}}</span>单
                        </div>
                      </div>
                    </div>
                  </el-col>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">已取消订单</div>
                        <div class="text_color">
                          <span>{{orderStat.yiQuXiao ? orderStat.yiQuXiao : 0}}</span>单
                        </div>
                      </div>
                    </div>
                  </el-col>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">已完成订单</div>
                        <div class="text_color">
                          <span>{{orderStat.yiWanChen ? orderStat.yiWanChen : 0}}</span>单
                        </div>
                      </div>
                    </div>
                  </el-col>

                </el-row>
              </el-tab-pane>
              <el-tab-pane label="收益统计" name="seven">
                <el-row>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">总收益</div>
                        <div class="text_color">
                          <span>{{shouyiData.allMoney ? shouyiData.allMoney : 0 }}</span>元
                        </div>
                      </div>
                    </div>
                  </el-col>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">预约代驾收益</div>
                        <div class="text_color">
                          <span>{{shouyiData.hopeMoney ? shouyiData.hopeMoney : 0 }}</span>元
                        </div>
                      </div>
                    </div>
                  </el-col>

                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">朋友代叫收益</div>
                        <div class="text_color">
                          <span>{{shouyiData.otherMoney ? shouyiData.otherMoney : 0}}</span>元
                        </div>
                      </div>
                    </div>
                  </el-col>
                  <el-col :span="6" class="cards">
                    <div class="box">
                      <div class="box_num">
                        <div class="box_color">及时代驾收益</div>
                        <div class="text_color"><span>{{shouyiData.nowMoney ? shouyiData.nowMoney : 0}}</span>元
                        </div>
                      </div>
                    </div>
                  </el-col>
                </el-row>
              </el-tab-pane>
              <el-tab-pane label="任务分析" name="renwu">
              	<el-row>
              		<el-col :span="6" class="cards">
              			<div class="box">
              				<div class="box_num">
              					<div class="box_color">发单总金额</div>
              					<div class="text_color">
              						<span>{{taskStat.billMoney ? taskStat.billMoney : 0}}</span>元</div>
              				</div>
              			</div>
              		</el-col>
              		<el-col :span="6" class="cards">
              			<div class="box">
              				<div class="box_num">
              					<div class="box_color">接单总金额</div>
              					<div class="text_color">
              						<span>{{taskStat.receivingMoney ? taskStat.receivingMoney : 0}}</span>元</div>
              				</div>
              			</div>
              		</el-col>
              		<el-col :span="6" class="cards">
              			<div class="box">
              				<div class="box_num">
              					<div class="box_color">发单数量</div>
              					<div class="text_color">
              						<span>{{taskStat.billCount ? taskStat.billCount : 0}}</span>笔</div>
              				</div>
              			</div>
              		</el-col>
              		<el-col :span="6" class="cards">
              			<div class="box">
              				<div class="box_num">
              					<div class="box_color">接单数量</div>
              					<div class="text_color">
              						<span>{{taskStat.reveivingCount ? taskStat.reveivingCount : 0}}</span>笔</div>
              				</div>
              			</div>
              		</el-col>
              	</el-row>
              </el-tab-pane>
            </el-tabs>
          </div>
        </div>
      </el-tab-pane>

      <!-- 缴纳保证金 -->
      <el-dialog title="缴纳保证金" :visible.sync="dialogFormVisible2" center>
        <div style="padding-left:115px;font-size: 18px;color: #333;margin-bottom: 15px;">您还没有缴纳店铺保证金,请先缴纳保证金.
        </div>
        <div style="padding-left:115px;margin-bottom: 15px;">
          <img :src="cashimg" alt="">
        </div>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;">保证金期限：</span>
          <el-radio-group v-model="limitCash">
            <el-radio :label="1">永久期限</el-radio>
            <el-radio :label="2">一年期限</el-radio>
          </el-radio-group>
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible2 = false">取 消</el-button>
          <el-button type="primary" @click="cashNoticeTo()">缴纳保证金</el-button>
        </div>
      </el-dialog>
      <!-- 申请退款 -->
      <el-dialog title="申请退款" :visible.sync="dialogFormVisible3" center>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;position: relative;top: -65px;">退款理由：</span>
          <el-input v-model="refund" style="width:45%;" type="textarea" :rows="4" placeholder="请输入退款理由">
          </el-input>
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible3 = false">取 消</el-button>
          <el-button type="primary" @click="refundNoticeTo()">确定</el-button>
        </div>
      </el-dialog>
      <!-- 修改微信二维码 -->
      <el-dialog title="修改微信二维码" :visible.sync="dialogFormVisible4" center>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;">微信提现二维码：</span>
          <div
            style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;margin-left:200px">
            <el-upload class="avatar-uploader" v-model="wxImg" :action="$http.adornUrlUp('alioss/upload')"
              :show-file-list="false" :on-success="handleAvatarSuccess">
              <img v-if="wxImg" :src="wxImg" class="avatar" style="width: 148px;height: 148px;" />
              <i v-else class="el-icon-plus avatar-uploader-icon" style="font-size: 28px;color: #8c939d"></i>
            </el-upload>
          </div>

        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible4 = false">取 消</el-button>
          <el-button type="primary" @click="wximgNoticeTo()">确定</el-button>
        </div>
      </el-dialog>
      <!-- 提现 -->
      <el-dialog title="提现" :visible.sync="dialogFormVisible5" center>

        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;">提现类型：</span>
          <el-radio-group v-model="txtype">
            <el-radio :label="1">支付宝</el-radio>
            <el-radio :label="2">微信</el-radio>
          </el-radio-group>
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible5 = false">取 消</el-button>
          <el-button type="primary" @click="deposit()">确定</el-button>
        </div>
      </el-dialog>
      <!-- 添加、修改驿站 -->
      <el-dialog :title="titlesYz" :visible.sync="dialogFormVisible6" center>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;">驿站名称：</span>
          <el-input style="width:50%;" v-model="stationNames" type="text" placeholder="驿站名称"></el-input>
        </div>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;">驿站地址：</span>
          <el-input style="width:50%;" v-model="stationDetails" type="text" placeholder="请输入驿站地址"></el-input>
        </div>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;">排序：</span>
          <el-input style="width:50%;" v-model="sort" type="number" min="0" placeholder="请输入排序"></el-input>
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible6 = false">取 消</el-button>
          <el-button type="primary" @click="refusetoYz()">确 定</el-button>
        </div>
      </el-dialog>
      <!-- 添加、修改金额 -->
      <el-dialog :title="titles" :visible.sync="dialogFormVisibleJes" center>
        <div style="margin-bottom: 10px;display:flex;" v-if="titles=='修改金额'">
          <span style="width: 200px;display: inline-block;text-align: right;">修改类型：</span>
          <el-radio-group v-model="moneyType">
            <el-radio :label="1">添加</el-radio>
            <el-radio :label="2">减少</el-radio>
          </el-radio-group>
        </div>
        <div style="margin-bottom: 10px;">
          <span style="width: 200px;display: inline-block;text-align: right;">金额：</span>
          <el-input style="width:50%;" v-model="moneys" type="text" placeholder="请输入金额"></el-input>
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisibleJes = false">取 消</el-button>
          <el-button type="primary" @click="timesJe()">确 定</el-button>
        </div>
      </el-dialog>
    </el-tabs>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        size: 10,
        page: 1,
        limit: 10,
        id: '',
        title: '',
        refund: '',
        ordersId: '',
        mobile: '',
        money: '',
        outMoney: '',
        orderNum: '',
        status: 0,
        status1: -1,
        sumincome: '',
        totalnum: 0,
        income: '',
        wxincome: '',
        zfbincome: '',
        yueicome: '',
        ordersum0: '',
        ordersum1: '',
        ordersum2: '',
        expressName: '',
        expressNumber: '',
        limitCash: 1,
        number: 1,
        orderType: 5,
        cashimg: '',
        form: {
          zhiFuBao: '',
          zhiFuBaoName: ''
        },
        form1: {
          money: '',
          zhiFuBao: '',
          zhiFuBaoName: '',
          bankCard: '',
          bankCardAddress: '',
          bankCardName: '',
          bankCardUserName: '',
        },
        info: {
          stockDate: this.getNowTime(), //日期
        },
        way: 3,
        ways: [{
          value: 3,
          label: '按天查询'
        }, {
          value: 2,
          label: '按月查询'
        }, {
          value: 1,
          label: '按年查询'
        }],
        endTime: '',
        newdata: '',
        isshow: false,
        withdrawData: [],
        formLabelWidth: '200px',
        activeName: 'first',
        tableDataLoading: false,

        tableDataLoading1: false,
        dialogFormVisible: false,
        dialogFormVisible1: false,
        dialogFormVisible2: false,
        dialogFormVisible3: false,
        dialogFormVisible4: false,
        dialogFormVisible5: false,
        dialogFormVisible6: false,
        tableData: {},
        tableData1: [],
        tableDataYe: {},
        wxImg: '',
        txtype: '',
        detail: {},
        titlesYz: '添加',
        stationNames: '',
        stationDetails: '',
        sort: '',
        stationName: '',
        tixianData: {

        },
        statesnum: [{
            label: '全部',
            value: 0
          },
          {
            label: '待支付',
            value: 1
          },
          {
            label: '待送达',
            value: 3
          },
          {
            label: '已完成',
            value: 4
          },
          {
            label: '已取消',
            value: 5
          },
        ],
        statesnum1: [{
            label: '全部',
            value: -1
          },
          {
            label: '待支付',
            value: 0
          },
          {
            label: '进行中',
            value: 1
          },
          {
            label: '已完成',
            value: 2
          },
          {
            label: '已取消',
            value: 3
          },
        ],
        content: '',
        tableDataOrder: {},
        tableDataJz: {},
        totalMoney: 0,
        tableDataUser: {},
        isCampus: '',
        nickName: '',
        userName: '',
        ordersNo: '',
        typeNum: [{
            value: '',
            label: '全部'
          },
          {
            value: 1,
            label: '服务订单'
          },
          {
            value: 2,
            label: '会员订单'
          },
        ],
        type: '',
        phone1: '',
        status1: 0,
        gameId: '',
        homeData1: [],
        phone: '',
        taskstates: [{
            label: '全部',
            value: 0
          },
          {
            label: '已接单',
            value: 1
          },
          {
            label: '已送达',
            value: 2
          }
        ],
        tableData2: {},
        helpCampusId: '',

        // 数据统计----------
        activeNameSj: 'first',
        tableData: {},
        tableData2: {
          list: [],
          totalCount: 0
        },
        colonelData: [],
        commodityData: [],
        userjfData: [],
        incomeData: [],
        tableDataLoading: true,
        flag: 'day',
        usersumData: {},
        taskStat: {},
        orderStat: {},
        profitStat: {},
        data: '',
        time: '',
        platform: '',
        type: '',
        balance: -1,
        info: {
          stockDate: this.getNowTime(), //日期
        },
        flags: [{
					value: 'day',
					label: '按天查询'
				}, {
					value: 'month',
					label: '按月查询'
				}, {
					value: 'year',
					label: '按年查询'
				}],
        rechgeData: {},
        shouyiData: {},
        chatNumDrz: 0,
        chatNumDsm: 0,
        chatNumDts: 0,
        chatNumJjqz: 0,
        chatNumJg: 0,
        chatNumCs: 0,

        totalnum: {},
        sumincome: '',
        income: '',
        wxincome: '',
        zfbincome: '',
        yueicome: '',
        ordersum0: '',
        ordersum1: '',
        ordersum2: '',
        refundIncome: '',
        refundMoney: '',
        refundNum: '',
        tableDataShop: {},
        tableDataUser: {},
        tableDataDlys: {},
        tableDataJs: {},
        tableDataUserZh: {},
        dialogFormVisibleJes: false,
        titles: '',
        moneyType: 1,
        moneys: '',


      }
    },
    filters: {
      numFilter(value) {
        let realVal = ''
        if (!isNaN(value) && value !== '') {
          // 截取当前数据到小数点后两位
          realVal = parseFloat(value).toFixed(2)
        } else {
          realVal = '--'
        }
        return realVal
      }
    },
    methods: {
      // 返回上一级
      prev() {
        this.$router.back()
      },
      handleSizeChange(val) {
        this.size = val
        this.withdrawSelect()
      },
      handleCurrentChange(val) {
        this.page = val
        this.withdrawSelect()
      },
      handleSizeChangeYe(val) {
        this.size = val
        this.dataSelectYe()
      },
      handleCurrentChangeYe(val) {
        this.page = val
        this.dataSelectYe()
      },
      handleSizeChangeOrd(val) {
        this.limit = val;
        this.dataOrderSelect();
      },
      handleCurrentChangeOrd(val) {
        this.page = val;
        this.dataOrderSelect();
      },


      //处理默认选中当前日期
      getNowTime() {
        var now = new Date()
        var year = now.getFullYear() //得到年份
        var month = now.getMonth() //得到月份
        var date = now.getDate() //得到日期
        month = month + 1
        month = month.toString().padStart(2, '0')
        date = date.toString().padStart(2, '0')
        var defaultDate = `${year}-${month}-${date}`
        return defaultDate
        this.$set(this.info, 'stockDate', defaultDate)
      },

      handleClick(tab, event) {
        this.status = 0
        this.status1 = -1
        this.page = 1
        if (tab._props.label == '代理信息') {
          this.dataSelectUs()
        }

        if (tab._props.label == '提现记录') {
          this.withdrawSelect()
        }
        if (tab._props.label == '钱包明细') {
          this.dataSelectYe()
        }
        if (tab._props.label == '提现账号') {
          console.log(this.tixianData)
          this.dataSelectUs()
        }
        if (tab._props.label == '数据统计') {
          this.colonel()
          this._getData() //用户统计
          this.incomeSelect()
        }



      },

      refundNoticeTo() {
        if (this.refund == '') {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '请输入退款理由',
            type: 'warning'
          });
          return
        }
        this.$http({
          url: this.$http.adornUrl('orders/refund'),
          method: 'get',
          params: this.$http.adornParams({
            'ordersId': this.ordersId
          })
        }).then(({
          data
        }) => {
          if (data.status == 0) {
            this.$message({
              message: '退款申请成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.dialogFormVisible3 = false
                this.dataSelect1()
              }
            })
          } else {
            this.$message({
              message: data.msg,
              type: 'warning',
              duration: 1500,
              onClose: () => {}
            })
          }

        })
      },
      // 申请提现
      depositType(row) {
        this.txtype = ''
        this.outMoney = ''
        this.form1.zhiFuBao = this.tableData.zhiFuBao
        this.form1.zhiFuBaoName = this.tableData.zhiFuBaoName
        this.form1.money = this.tableData.money
        this.form1.bankCard = this.tableData.bankCard
        this.form1.bankCardAddress = this.tableData.bankCardAddress
        this.form1.bankCardName = this.tableData.bankCardName
        this.form1.bankCardUserName = this.tableData.bankCardUserName
        this.dialogFormVisible1 = true
      },
      // 提现
      deposit() {
        if (this.txtype == '') {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '请选择提现方式',
            type: 'warning'
          });
          return
        }
        console.log('this.txtype', this.txtype)
        if (this.txtype == 1) {
          let banStatus = this.$cookie.get('banStatus')
          let marginStatus = this.$cookie.get('marginStatus')
          if (banStatus == 2) {
            this.$message({
              message: '您的店铺出现违规情况，已被封禁，请联系总后台解封',
              type: 'error',
              duration: 3500,
            });
            return
          }
          if (marginStatus == 1 && this.cashvalue == 1) {
            this.dialogFormVisible2 = true
            this.cashdead()
            return
          }
          if (parseFloat(this.tableData.money) < 1) {
            this.$notify({
              title: '提示',
              duration: 1800,
              message: '可提现金额不足',
              type: 'warning'
            });
            return
          }
          if (this.tableData.zhiFuBao == null || this.tableData.zhiFuBao == '') {
            this.$notify({
              title: '提示',
              duration: 1800,
              message: '请先完善支付宝信息',
              type: 'warning'
            });
            return
          }
          if (this.tableData.zhiFuBaoName == null || this.tableData.zhiFuBaoName == '') {
            this.$notify({
              title: '提示',
              duration: 1800,
              message: '请先完善支付宝信息',
              type: 'warning'
            });
            return
          }
          if (this.tableData.bankCard == null || this.tableData.bankCard == '') {
            this.$notify({
              title: '提示',
              duration: 1800,
              message: '请先完善银行卡信息',
              type: 'warning'
            });
            return
          }
          if (this.tableData.bankCardAddress == null || this.tableData.bankCardAddress == '') {
            this.$notify({
              title: '提示',
              duration: 1800,
              message: '请先完善银行卡信息',
              type: 'warning'
            });
            return
          }
          if (this.tableData.bankCardName == null || this.tableData.bankCardName == '') {
            this.$notify({
              title: '提示',
              duration: 1800,
              message: '请先完善银行卡信息',
              type: 'warning'
            });
            return
          }
          if (this.tableData.bankCardUserName == null || this.tableData.bankCardUserName == '') {
            this.$notify({
              title: '提示',
              duration: 1800,
              message: '请先完善银行卡信息',
              type: 'warning'
            });
            return
          }

          this.dialogFormVisible1 = true
          this.form1.zhiFuBao = this.tableData.zhiFuBao
          this.form1.zhiFuBaoName = this.tableData.zhiFuBaoName
          this.form1.money = this.tableData.money

          this.form1.bankCard = this.tableData.bankCard
          this.form1.bankCardAddress = this.tableData.bankCardAddress
          this.form1.bankCardName = this.tableData.bankCardName
          this.form1.bankCardUserName = this.tableData.bankCardUserName

          this.outMoney = this.tableData.money
        } else {
          this.form1.money = this.tableData.money
          this.outMoney = this.tableData.money
          this.depositTo()
        }
        // }

      },
      // 获取保证金期限
      cashdead() {
        this.$http({
          url: this.$http.adornUrl('self/margin/marginList'),
          method: 'post',
          data: this.$http.adornData({})
        }).then(({
          data
        }) => {
          let returnData = data.data;
          this.price1 = returnData.price1
          this.price2 = returnData.price2
        })
      },
      // 缴纳保证金
      cashNoticeTo() {
        this.title = '多商户保证金：'
        if (this.limitCash == 1) {
          this.cashMoney = this.price1
          this.type = 1
        } else {
          this.cashMoney = this.price2
          this.type = 2
        }
        this.$http({
          url: this.$http.adornUrl('orders/save'),
          method: 'post',
          data: this.$http.adornData({
            number: this.number,
            orderType: this.orderType,
            payMoney: this.cashMoney,
            storeMoney: this.cashMoney,
            price: this.cashMoney,
            title: this.title + this.cashMoney,
            img: this.cashimg,
            merchantId: this.merchantId,
            storeName: this.storeName,
            consignee: this.storeName,
            mobile: this.mobile,
            detail: this.detail,
            type: this.type
          })
        }).then(({
          data
        }) => {
          let returnData = data.data;
          this.orderId = returnData.id
          this.dialogFormVisible = false
          this.title = ''
          this.paySelect(this.orderId)
        })
      },
      // 支付宝支付
      paySelect(id) {
        this.$http({
          url: this.$http.adornUrl('aliPay/payWeb'),
          method: 'get',
          params: this.$http.adornParams({
            'orderId': id
          })
        }).then(({
          data
        }) => {
          this.tableDataLoading = false
          let returnData = data.data;
          let text = this.$router.resolve({
            path: "/alipay",
            query: {
              htmls: returnData.body
            }
          })
          // 打开一个新的页面
          window.open(text.href, '_blank')
        })
      },
      // 提现申请
      depositTo() {
        if (this.txtype == '') {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '请选择提现方式',
            type: 'warning'
          });
          return
        }

        if (this.outMoney > this.form1.money) {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '提现金额不足',
            type: 'warning'
          });
          return
        }
        if (this.outMoney < 1) {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '提现金额不能小于1',
            type: 'warning'
          });
          return
        }
        // this.tableDataLoading1 = true
        let userId = this.$route.query.userId
        this.$http({
          url: this.$http.adornUrl('cash/agentCashMoney'),
          method: 'post',
          params: this.$http.adornParams({
            'money': this.outMoney,
            'userId': userId,
            'classify': this.txtype
          })
        }).then(({
          data
        }) => {
          if (data.code == 0) {
            this.$message({
              message: '提现申请成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.dialogFormVisible1 = false
                this.tableDataLoading1 = false
                this.dataSelectUs()
                this.withdrawSelect()
              }
            })
          } else {
            this.$message({
              message: data.msg,
              type: 'warning',
              duration: 1500,
              onClose: () => {}
            })
          }
        })
      },
      // 修改支付宝信息弹框
      updates(row) {
        let banStatus = this.$cookie.get('banStatus')
        if (banStatus == 2) {
          this.$message({
            message: '您的店铺出现违规情况，已被封禁，请联系总后台解封',
            type: 'error',
            duration: 3500,
          })
        } else {
          this.dialogFormVisible = true
          this.form.zhiFuBao = row.zhiFuBao
          this.form.zhiFuBaoName = row.zhiFuBaoName
        }

      },

      // 修改支付宝信息
      amendNoticeTo() {
        if (this.form.zhiFuBao == '') {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '请输入支付宝账号',
            type: 'warning'
          });
          return
        }
        if (this.form.zhiFuBaoName == '') {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '请输入支付宝名称',
            type: 'warning'
          });
          return
        }
        let sysUserId = this.$route.query.userId
        this.$http({
          url: this.$http.adornUrl('sys/user/updateCampusUser'),
          method: 'post',
          data: this.$http.adornData({
            'userId': sysUserId,
            'zhiFuBao': this.form.zhiFuBao,
            'zhiFuBaoName': this.form.zhiFuBaoName,
          })
        }).then(({
          data
        }) => {
          if (data.code == 0) {
            this.$message({
              message: '修改成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.dialogFormVisible = false
                this.dataSelectUs()
                this.withdrawSelect()
              }
            })

          } else {
            this.$message({
              message: data.msg,
              type: 'warning',
              duration: 1500,
              onClose: () => {}
            })
          }
        })
      },

      // 获取钱包信息
      dataSelectUs() {
        let merchantId = this.$cookie.get('merchantId')
        let userId = this.$route.query.userId
        this.tableDataLoading = true
        this.$http({
          url: this.$http.adornUrl('sys/user/info/' + userId),
          method: 'get',
          params: this.$http.adornParams({})
        }).then(({
          data
        }) => {
          this.tableDataLoading = false
          let returnData = data.user
          this.tableData = returnData
          this.tixianData = returnData
		  this.detail = returnData
          if (returnData.zhifubaoName) {
            this.tixianData.zhiFuBaoName = returnData.zhifubaoName
          } else {
            this.tixianData.zhiFuBaoName = ''
          }
          if (returnData.zhifubao) {
            this.tixianData.zhiFuBao = returnData.zhifubao
          } else {
            this.tixianData.zhiFuBao = ''
          }
          if (returnData.bankCard) {
            this.tixianData.bankCard = returnData.bankCard
          } else {
            this.tixianData.bankCard = ''
          }
          if (returnData.bankCardAddress) {
            this.tixianData.bankCardAddress = returnData.bankCardAddress
          } else {
            this.tixianData.bankCardAddress = ''
          }
          if (returnData.bankCardName) {
            this.tixianData.bankCardName = returnData.bankCardName
          } else {
            this.tixianData.bankCardName = ''
          }
          if (returnData.bankCardUserName) {
            this.tixianData.bankCardUserName = returnData.bankCardUserName
          } else {
            this.tixianData.bankCardUserName = ''
          }
		  this.tixianData.roleIdList = [5]
		  this.tixianData.city  = returnData.city
		  this.tixianData.roleIdList = returnData.roleIdList
          this.cityId = data.user.cityId
          this.helpCampusId = data.user.helpCampusId
        })
      },
      // 提现记录
      withdrawSelect() {

        let sysUserId = this.$route.query.userId

        this.tableDataLoading = true
        this.$http({
          // url: this.$http.adornUrl('cash/selectAdminHelpProfit'),
          // method: 'get',
          // params: this.$http.adornParams({
          // 	'page': this.page,
          // 	'limit': this.limit,
          // 	'zhifubaoName': this.zhifubaoName,
          // 	'zhifubao': this.zhifubao,
          // 	'startTime': this.startTime,
          // 	'endTime': this.endTime,
          // 	'phone': this.phone,
          // 	'classify': this.classify,
          //   'userType':1,

          url: this.$http.adornUrl('cash/selectPayDetails'),
          method: 'get',
          params: this.$http.adornParams({
            'page': this.page,
            'limit': this.limit,
            'userId': sysUserId,
            'userType':'',
          })
        }).then(({
          data
        }) => {
          this.tableDataLoading = false
          let returnData = data.data
          this.withdrawData = returnData
        })
      },


      // 获取保证金列表数据
      dataSelect1() {
        let storeId = this.$cookie.get('storeId')
        let page = this.page - 1
        this.tableDataLoading = true
        this.$http({
          url: this.$http.adornUrl('self/margin/storeList'),
          method: 'get',
          params: this.$http.adornParams({
            'page': page,
            'size': this.size,
            'storeId': storeId
          })
        }).then(({
          data
        }) => {
          this.tableDataLoading = false
          let returnData = data.data;
          this.tableData1 = returnData
          let onedata = new Date()
          this.newdata = onedata.getTime()
          // let enTime = returnData.endTime
          // this.endTime = enTime.getTime()
          console.log(this.newdata)
          // console.log(this.endTime)
        })
      },
      // 钱包明细
      dataSelectYe() {
        let sysUserId = this.$route.query.userId
        this.tableDataLoading = true
        this.$http({
          url: this.$http.adornUrl('admin/agentCityDetails/getAgentCityDetailsList'),
          method: 'get',
          params: this.$http.adornParams({
            'page': this.page,
            'limit': this.size,
            'sysUserId': sysUserId,
            'classify':2,
          })
        }).then(({
          data
        }) => {
          this.tableDataLoading = false
          let returnData = data.data;
          this.tableDataYe = returnData

        })
      },
      // 修改二维码
      updatesEwm(row) {
        this.wxImg = row.cashQrCode

        this.dialogFormVisible4 = true
      },
      handleAvatarSuccess(file, fileList) {
        this.wxImg = file.data
      },
      // 确认修改二维码
      wximgNoticeTo() {
        let merchantId = this.$cookie.get('merchantId')
        this.$http({
          url: this.$http.adornUrl('self/merchantApply/updateWx'),
          method: 'get',
          params: this.$http.adornParams({
            'merchantId': merchantId,
            'cashQrCode': this.wxImg
          })
        }).then(({
          data
        }) => {
          if (data.status == 0) {
            this.$message({
              message: '修改成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.dialogFormVisible4 = false
                this.dataSelectUs()
              }
            })
          } else {
            this.$message({
              message: data.msg,
              type: 'warning',
              duration: 1500,
              onClose: () => {}
            })
          }

        })
      },

      // 提现二维码
      handleAvatarSuccess1(file, fileList) {
        this.tixianData.cashQrCode = file.data
        console.log('this.tixianData.cashQrCode', this.tixianData.cashQrCode)
      },
      querenBtn() {
        if (this.tixianData.zhifubaoName == '' || !this.tixianData.zhifubaoName) {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '请输入支付宝名称',
            type: 'warning'
          })
          return
        }
        if (this.tixianData.zhifubao == '' || !this.tixianData.zhifubao) {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '请输入支付宝账号',
            type: 'warning'
          })
          return
        }
        // if (this.tixianData.bankCardName == '' || !this.tixianData.bankCardName) {
        //   this.$notify({
        //     title: '提示',
        //     duration: 1800,
        //     message: '请输入银行卡名称',
        //     type: 'warning'
        //   })
        //   return
        // }
        // if (this.tixianData.bankCard == '' || !this.tixianData.bankCard) {
        //   this.$notify({
        //     title: '提示',
        //     duration: 1800,
        //     message: '请输入银行卡账号',
        //     type: 'warning'
        //   })
        //   return
        // }
        // if (this.tixianData.bankCardUserName == '' || !this.tixianData.bankCardUserName) {
        //   this.$notify({
        //     title: '提示',
        //     duration: 1800,
        //     message: '请输入银行卡姓名',
        //     type: 'warning'
        //   })
        //   return
        // }
        // if (this.tixianData.bankCardAddress == '' || !this.tixianData.bankCardAddress) {
        //   this.$notify({
        //     title: '提示',
        //     duration: 1800,
        //     message: '请输入开户行地址',
        //     type: 'warning'
        //   })
        //   return
        // }
        if (this.tixianData.cashQrCode == ''||!this.tixianData.cashQrCode) {
        	this.$notify({
        		title: '提示',
        		duration: 1800,
        		message: '请上传提现二维码',
        		type: 'warning'
        	})
        	return
        }
        let userId = this.$route.query.userId
        this.$http({
          url: this.$http.adornUrl('sys/user/update'),
          method: 'post',
          data: this.$http.adornData(this.tixianData)
        }).then(({
          data
        }) => {
          if (data.code == 0) {
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.dataSelectUs()
              }
            })
          } else {
            this.$message({
              message: data.msg,
              type: 'warning',
              duration: 1500,
              onClose: () => {}
            })
          }

        })
      },
      // 获取订单数据列表
      dataOrderSelect() {
        let sysUserId = this.$route.query.userId
        this.tableDataLoading = true
        this.$http({
          url: this.$http.adornUrl('help/selectStatusHelpOrders'),
          method: 'get',
          params: this.$http.adornParams({
            'page': this.page,
            'limit': this.limit,
            'phone': this.phone,
            'status': this.status,
            'content': this.content,
            'campus': sysUserId
          })
        }).then(({
          data
        }) => {
          this.tableDataLoading = false
          for (var i in data.data.list) {


            if (data.data.list[i].image) {
              data.data.list[i].images = data.data.list[i].image.split('^^^')

            }
            if (data.data.list[i].expressMsg) {
              data.data.list[i].expressMsgs = data.data.list[i].expressMsg.split('^^^')
            }
            var msgArr = []
            if (data.data.list[i].images) {
              for (var j in data.data.list[i].images) {
                if (data.data.list[i].expressMsgs) {
                  for (var k in data.data.list[i].expressMsgs) {
                    if (j == k) {
                      var magDate = {}
                      magDate.img = data.data.list[i].images[j]
                      magDate.text = data.data.list[i].expressMsgs[k]
                      console.log('data.data.list[i].expressMsgs', data.data.list[i]
                        .expressMsgs[k])
                    }
                  }
                  msgArr.push(magDate)
                } else {
                  for (var k in data.data.list[i].images) {
                    var magDate = {}
                    magDate.text = ''
                    magDate.img = data.data.list[i].images[k]
                    console.log('data.data.list[i].expressMsgs', data.data.list[i].images[k])

                  }
                  msgArr.push(magDate)
                }


              }
            } else {
              for (var k in data.data.list[i].expressMsgs) {

                var magDate = {}
                magDate.img = ''
                magDate.text = data.data.list[i].expressMsgs[k]
                // console.log('data.data.list[i].expressMsgs',data.data.list[i].expressMsgs[k])

              }
              msgArr.push(magDate)
            }

            data.data.list[i].xinxi = msgArr
            console.log('data.data.list[i].xinxi', i, )
          }
          // for (var i in data.data.list) {
          // 	if (data.data.list[i].image) {
          // 		data.data.list[i].image = data.data.list[i].image.split(',')
          // 	}
          // }
          let returnData = data.data
          this.tableDataOrder = returnData
          console.log('...', this.tableDataOrder)
        })
      },

      // 详情跳转
      updates(userId) {
        if (userId) {
          this.$router.push({
            path: '/userDetail',
            query: {
              userId: userId
            }
          })
        }

      },

      // 数据统计-----------------
      // Tabs点击事件
      handleClickSj(tab, event) {
        this.page = 1

        if (tab._props.label == '订单统计') {
          this.colonel()
        }

        if (tab._props.label == '收益统计') {
          this.shouyiSelect()
        }
        if (tab._props.label == '任务分析') {
        	this.taskData()

        }

      },
      // 订单分析选择日期
      animeOrder() {
        this.taskData()
        this.colonel()
        this.shouyiSelect()

      },
      // 订单分析年月日
      orderfenxi(value) {
        this.taskData()
        this.colonel()
        this.shouyiSelect()

      },
      //处理默认选中当前日期
      getNowTime() {
        var now = new Date();
        var year = now.getFullYear(); //得到年份
        var month = now.getMonth(); //得到月份
        var date = now.getDate(); //得到日期
        var hh = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
        var mm = now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
        var ss = now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
        month = month + 1;
        month = month.toString().padStart(2, "0");
        date = date.toString().padStart(2, "0");
        var defaultDate = `${year}-${month}-${date} ${hh}:${mm}:${ss}`;
        return defaultDate;
        this.$set(this.info, "stockDate", defaultDate);
      },
      // 用户统计
      _getData() {
        var city = this.tixianData.city
        this.$http({
          url: this.$http.adornUrl('user/homeMessage'),
          method: 'get',
          params: this.$http.adornParams({
            'city': city
          })
        }).then(({
          data
        }) => {
          if (data.code == 0) {
            let returnData = data.data;
            this.tableData = returnData
          }

        })
      },
      // 收入统计
      incomeSelect() {
        var city = this.tixianData.city
        this.$http({
          url: this.$http.adornUrl('user/selectOrdersMoney'),
          method: 'get',
          params: this.$http.adornParams({
            'date': this.info.stockDate,
            'type': this.flag,
            'city': city
          })
        }).then(({
          data
        }) => {
          if (data.code == 0) {
            let returnData = data.data;
            this.profitStat = returnData
          }
        })
      },
      //任务分析（下）
      taskData() {
        var city = this.tixianData.city
        this.$http({
         url: this.$http.adornUrl('adminerrand/taskAnalysis'),
         method: 'get',
         params: this.$http.adornParams({
         	'date': this.info.stockDate,
         	'dateType': this.flag,
         	'page':this.page,
         	'limit':this.limit,
           'cityId':this.cityId,
         })
        }).then(({
          data
        }) => {
          let returnData = data.data;
          this.taskStat = returnData
        })
      },
      // 订单统计
      colonel() {
        var city = this.tixianData.city
        this.tableDataLoading = true
        this.$http({
          url: this.$http.adornUrl('adminerrand/selectOrderByStatus'),
          method: 'get',
          params: this.$http.adornParams({
          	'date': this.info.stockDate,
          	'dateType': this.flag,
            'cityId':this.cityId,
          })
        }).then(({
          data
        }) => {
          this.tableDataLoading = false
          if (data.code == 0) {
            let returnData = data.data
            this.orderStat = returnData
          }
        })
      },

      // 收益统计
      shouyiSelect() {
        var city = this.tixianData.city
        this.$http({
          url: this.$http.adornUrl('cash/agentStatistics'),
          method: 'get',
          params: this.$http.adornParams({
            'date': this.info.stockDate,
            'dateType': this.flag,
            'cityId':this.cityId,
          })
        }).then(({
          data
        }) => {
          if (data.code == 0) {
            let returnData = data.data
            this.shouyiData = returnData
          }
        })
      },

      // 修改金额弹框
      depositTx() {
        this.titles = '修改金额'
        this.moneyType = 1
        this.moneys = ''
        this.dialogFormVisibleJes = true
      },
      // 添加、修改师傅金额
      timesJe() {
        if (this.moneyType === '') {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '请选择修改类型',
            type: 'warning'
          });
          return
        }
        if (this.moneys === '') {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '请输入金额',
            type: 'warning'
          });
          return
        }
        if (Number(this.moneys) <= 0) {
          this.$notify({
            title: '提示',
            duration: 1800,
            message: '金额必须大于0',
            type: 'warning'
          });
          return
        }
        let sysUserId = this.$route.query.userId
        var datas = {}
        datas.money = this.moneys
        datas.sysUserId = sysUserId
        datas.type = this.moneyType
        this.$http({
          url: this.$http.adornUrl('admin/agentUserMoney/updateUserMoney'),
          method: 'get',
          params: this.$http.adornParams(datas)
        }).then(({
          data
        }) => {
          if (data.code == 0) {
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.dialogFormVisibleJes = false
                this.dataSelectUs()
              }
            })
          } else {
            this.$message({
              message: data.msg,
              type: 'warning',
              duration: 1500,
              onClose: () => {}
            })
          }
        })
      },
    },
    mounted() {
      this.dataSelectUs()
      this.withdrawSelect()

      this.detail = JSON.parse(this.$route.query.detail)
      console.log('this.detail', this.detail)
    }
  };
</script>
<style scoped="scoped">
  .box {
    height: 156px;
    padding: 24px;
    border: 1px solid #eee;
    margin: 15px 10px;
  }

  .box_num {
    font-size: 14px;
    color: #66b1ff;
  }

  .box_num .box_color {
    color: #333;
    font-size: 14px;
    margin-bottom: 15px;
  }

  .box_num div span {
    font-size: 20px;
    margin-left: 5px;
  }

  .text_color {
    color: #4f9dec;
    margin-top: 50px;
  }

  .text_color span {
    margin-right: 5px;
  }

  .text_color1 {
    margin-top: 15px;
  }

  .shop_item {
    margin-top: 20px;
  }

  .imgWrap .avatar-uploader .el-upload {
    width: 60px;
  }

  .el-table .cell {
    text-align: center !important;
  }

  .el-tag--medium {
    margin-right: 10px;
  }
</style>
